/*************************************************************************
 *
 *   file		: CasterInfo.cs
 *   copyright		: (C) The WCell Team
 *   email		: info@wcell.org
 *   last changed	: $LastChangedDate: 2009-09-10 21:00:24 +0100 (Thu, 10 Sep 2009) $
 *   last author	: $LastChangedBy: dominikseifert $
 *   revision		: $Rev: 1091 $
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *************************************************************************/

using WCell.Constants;
using WCell.Core;
using WCell.RealmServer.Entities;
using WCell.RealmServer.Factions;

namespace WCell.RealmServer.Spells.Auras
{
	/// <summary>
	/// TODO: Needs to be fixed
	/// </summary>
	public class CasterInfo
	{
		public readonly EntityId CasterId;
		public readonly Faction Faction;
		public readonly ObjectTypes ObjectType;

		WorldObject m_caster;
		int m_level;

		public CasterInfo(WorldObject caster)
		{
			CasterId = caster.EntityId;
			Faction = caster.Faction;
			m_level = caster.CasterLevel;
			ObjectType = caster.Type;
			m_caster = caster;
		}

		public CasterInfo()
		{
		}

		public int Level
		{
			get
			{
				return m_level;
			}
			set
			{
				m_level = value;
			}
		}

		public WorldObject Caster
		{
			get
			{
				return m_caster;
			}
			internal set
			{
				m_caster = value;
			}
		}

		/// <summary>
		/// Returns the Caster as a Unit (if exists)
		/// </summary>
		public Unit CasterUnit
		{
			get
			{
				return m_caster as Unit;
			}
		}

		//public DynamicObject CasterObject
		//{
		//    get
		//    {
		//        return WorldMgr.GetObject(Id) as DynamicObject;
		//    }
		//}
	}
}
